# Maintainer: Jan Alexander Steffens (heftig) <heftig@archlinux.org>
# Contributor: Ionut Biru <ibiru@archlinux.org>

pkgname=accountsservice
pkgver=0.6.55
pkgrel=3
pkgdesc="D-Bus interface for user account query and manipulation"
url="https://gitlab.freedesktop.org/accountsservice/accountsservice"
arch=(x86_64)
license=(GPL3)
depends=(glib2 polkit systemd shadow libxcrypt)
makedepends=(gtk-doc gobject-introspection git meson docbook-xsl xmlto)
provides=(libaccountsservice.so)
_commit=6d6f7d62fd18fe5a4d4c06cb1455887ca3abdd1d  # tags/0.6.55^0
source=("git+https://gitlab.freedesktop.org/accountsservice/accountsservice.git#commit=$_commit")
sha256sums=('SKIP')

pkgver() {
  cd $pkgname
  git describe --tags | sed 's/-/+/g'
}


prepare() {
  cd $pkgname
  sed -i '/dbus_conf_dir/s/sysconfdir/datadir/g' meson.build
}

build() {
  arch-meson $pkgname build \
    -D admin_group=wheel \
    -D systemd=true \
    -D docbook=true \
    -D gtk_doc=true \
    -D user_heuristics=false
  meson compile -C build
}

check() {
  meson test -C build
}

package() {
  DESTDIR="$pkgdir" meson install -C build

  # Fix permissions to match the ones the daemon sets
  chmod 0775 "$pkgdir/var/lib/AccountsService/icons"
}

# vim:set ts=2 sw=2 et:
